<% if @team.errors.any? %>
  $('#float-alert p').html("<%= escape_javascript(@team.errors.full_messages.join('<br/>')) %>");
<% else %>
  $("<%= escape_javascript(render @team) %>").appendTo("#teams");
  $('#float-alert p').html("Team '<%= escape_javascript(@team.name) %>' was created successfully");
  $('#add_team_form').fadeOut();
  $('#add_team_btn i').addClass("fa-plus-circle")
  $('#add_team_btn i').removeClass("fa-minus-circle")
<% end %>
$('#float-alert').fadeIn(setTimeOutAlertDelay());